<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8"); 

	String PAYTITLE = request.getParameter("PAYTITLE")==null ? "" : request.getParameter("PAYTITLE");
	String ENAME = request.getParameter("ENAME")==null ? "" : request.getParameter("ENAME");
	String PERNR = request.getParameter("PERNR")==null ? "" : request.getParameter("PERNR");
	String STEXT = request.getParameter("STEXT")==null ? "" : request.getParameter("STEXT");
	
	String BANKA = request.getParameter("BANKA")==null ? "" : request.getParameter("BANKA");
	String BANKN = request.getParameter("BANKN")==null ? "" : request.getParameter("BANKN");

	String PAYSUM_F = request.getParameter("PAYSUM_F")==null ? "" : request.getParameter("PAYSUM_F");
	String SUBTSUM_F = request.getParameter("SUBTSUM_F")==null ? "" : request.getParameter("SUBTSUM_F");
	String RECEIVEDSUM_F = request.getParameter("RECEIVEDSUM_F")==null ? "" : request.getParameter("RECEIVEDSUM_F");
	String PRERECEIVED_F = request.getParameter("PRERECEIVED_F")==null ? "" : request.getParameter("PRERECEIVED_F");
	
 	
	final int max_count = 12;
	String COUNT_P = request.getParameter("COUNT_P") == null ? "0" : request.getParameter("COUNT_P");
	int count_p = Integer.parseInt(COUNT_P);

	String COUNT_S = request.getParameter("COUNT_S") == null ? "0" : request.getParameter("COUNT_S");
	int count_s = Integer.parseInt(COUNT_S);


	String [] ITMNM_P = new String[max_count];
	String [] BETRG_P = new String[max_count];	
	String [] ITMNM_S = new String[max_count];		
	String [] BETRG_S = new String[max_count];		
	    
	int i=0;
	for(i=0; i<max_count; ++i) {
		if(i<count_p) {
			ITMNM_P[i] = request.getParameter("ITMNM_P" + Integer.toString(i)) == null ? "" : request.getParameter("ITMNM_P" + Integer.toString(i));
			BETRG_P[i] = request.getParameter("BETRG_P" + Integer.toString(i)) == null ? "" : request.getParameter("BETRG_P" + Integer.toString(i));
		}
		else {
			ITMNM_P[i] = "";
			BETRG_P[i] = "";
		}
	}
	
	for(i=0; i<max_count; ++i) {
		if(i<count_s) {
			ITMNM_S[i] = request.getParameter("ITMNM_S" + Integer.toString(i)) == null ? "" : request.getParameter("ITMNM_S" + Integer.toString(i));
			BETRG_S[i] = request.getParameter("BETRG_S" + Integer.toString(i)) == null ? "" : request.getParameter("BETRG_S" + Integer.toString(i));	
		}
		else {
			ITMNM_S[i] = "";
			BETRG_S[i] = "";
		}
	}
	
%>
    
<html>
<head>
<title>
급여명세서
</title> 


<style>
	td{font-size:11px;}
	.td_t1{
		font-size:35px;
		font-weight:bold;
		
	}
	.td_t2{
		font-size:16px;
		font-weight:bold;
	}
	
	.td_t3{
		font-size:14px;
		font-weight:bold;
	}
	
	.label01 {
		font-size:14px;
	}	
</style>


<script language="javascript">

  function Print(){
   document.all.ptLayer.style.display="none";
   //document.all.hdLayer.style.display="none";
   
   self.print();
   document.all.ptLayer.style.display="block";
  //document.all.hdLayer.style.display="block";
  }

</script>
</head>

<body  topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
<FORM name="webguiform" method=post >
         
         
<!-- HEAER print -->
<table width="710" height="150">
	<tr height="130">
		<td width=710 class=td_t1 align="center" valign="bottom"><%=PAYTITLE %> 명세서</td>
	</tr>
	<tr height="20"></tr>
</table>

<table width="710" cellspacing="0" cellpadding="0" border="1"  bordercolor="000000" style="border-collapse:collapse;border-width:1px;">
  <tr height="30"> 
    <td colspan="4" class=td_t2 align="center" bgcolor="#DFE9DA">기본내역</td>
  </tr>
  <tr height="30"> 
    <td class=td_t3 align="center" >성명</td>
    <td colspan="3" class=label01 align="center" >&nbsp;<%=ENAME %></td>
  </tr>
  <tr height="30"> 
    <td class=td_t3 align="center" >소속</td>
    <td colspan="3" class=label01 align="center" >&nbsp;<%=STEXT %></td>
  </tr>
  <tr height="30"> 
    <td width="25%" class=td_t3 align="center" >은행명</td>
    <td width="25%" class=label01 align="center" >&nbsp;<%=BANKA %></td>
     <td width="25%" class=td_t3 align="center" >계좌번호</td>
    <td width="25%" class=label01 align="center" >&nbsp;<%=BANKN %></td>
  </tr>
  <tr height="30"> 
    <td class=td_t3 align="center" >지급총액</td>
    <td class=label01 align="right" style="padding:10,10">&nbsp;<%= PAYSUM_F %></td>
     <td class=td_t3 align="center" >공제총액</td>
    <td class=label01 align="right" style="padding:10,10">&nbsp;<%= SUBTSUM_F %></td>
  </tr>
  <tr height="30"> 
    <td class=td_t3 align="center" >실수령액</td>
    <td class=label01 align="right" style="padding:10,10">&nbsp;<%= RECEIVEDSUM_F %></td>
     <td class=td_t3 align="center" >급여외소득</td>
    <td class=label01 align="right" style="padding:10,10">&nbsp;<%= PRERECEIVED_F %></td>
  </tr>
</table>
<br>
<br>
<table width="710" cellspacing="0" cellpadding="0" border="1"  bordercolor="000000" style="border-collapse:collapse;border-width:1px;">
  <tr height="30"> 
    <td colspan="2" class=td_t2 align="center" bgcolor="#DFE9DA">지급내역</td>
    <td colspan="2" class=td_t2 align="center" bgcolor="#DFE9DA">공제내역</td>
  </tr>
 <% 
	for(i=0; i<max_count; ++i) {
%>
  <tr height="30"> 
    <td width="25%" class=td_t3 align="center" >&nbsp;<%=ITMNM_P[i] %></td>
    <td width="25%" class=label01 align="right" style="padding:10,10">&nbsp;<%=BETRG_P[i] %></td>
     <td width="25%" class=td_t3 align="center" >&nbsp;<%=ITMNM_S[i] %></td>
    <td width="25%" class=label01 align="right" style="padding:10,10">&nbsp;<%=BETRG_S[i] %></td>
  </tr>
<% 
	}
%>
</table>
<!-- HEAER print -->
<table width="710" height="50">
	<tr height="50">
		<td width=710 class=td_t1 align="center" valign="bottom"><img src='./assets/images/wordmark_Top.png' width=400 height=60> </td>
	</tr>
</table>
  

<br/>
<!-- 버튼 이 미지 시작-->
     <div id="ptLayer">
      <table width="710" border="0" cellspacing="1" cellpadding="1">
		<tr>
			<td height="1" bgcolor="#bec6d1"></td>
		</tr>
        <tr> 
          <td align="center">
 			   <img src="assets/images/btnPrint.gif" style="cursor: pointer;" onclick="Print()" />
          </td>
        </tr>
        <!-- `Title_Bottom_Blank()` -->
      </table>
     </div>
      <!-- 버 튼 이미지 끝-->

  </form>
</body>
</html>
